#pragma once
#include <d3dx9.h>
#include <String.h>
#include <map>
using std::map;
using std::string;


typedef struct Texture
{
	LPDIRECT3DTEXTURE9 texture;
	int width, height;

	Texture():texture(NULL){}
	~Texture(){if(texture)texture->Release();}

	operator LPDIRECT3DTEXTURE9(){return texture;}
}Texture;

typedef map<string, Texture*> StrTexture_Map;
class TextureManager
{
private:
	StrTexture_Map _textureMap;

	bool loadTexture(string name);
public:
	TextureManager(void);
	~TextureManager(void);
	Texture* getTexture(string name);
};

